package com.learn.spring_mvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

@Controller
@RequestMapping("/exception")
public class ExceptionController {
    @GetMapping("/nestedServletException")
    public String exception1() {
        int i = 1 / 0;
        return "/index.jsp";
    }
    
    @GetMapping("/fileNotFoundException")
    public String exception2() throws FileNotFoundException {
        new FileInputStream("nonono");
        return "/index.jsp";
    }
}
